//请求用户数据
import request from "./request";
const isDev = import.meta.env.DEV;

export const api_login = (params) =>{
    let result = {};
    let userType = 1;
    if(isDev){
        result = new Promise((resolve,reject)=>{
            if(params.userName === 'admin'){
                userType = 999
            }
            setTimeout(()=>{
                resolve({
                    success: true,
                    data:{
                        user:{
                            userName,
                            userType,//管理员角色：999  普通用户：1
                        }
                    }
                })
            },800)
        })
    }else{
        result = request.post('',params)
    }
    return result
}